# coding=utf-8
"""
    @project: 15python_spider
    @Author：frank
    @file： 05_star_img.py
    @date：2023/12/29 21:12
"""
import random

import requests
from utils.UserAgent import user_agent_list

url = 'https://img2.baidu.com/it/u=3164130908,3465157821&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=666'
headers = {'User-Agent': random.choice(user_agent_list)}
res = requests.get(url, headers=headers)
with open('zhaoliyin.jpg', 'wb') as f:
    f.write(res.content)
